<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script>
    // 浏览器是按顺序执行， 遇到宏任务和微任务的时候会自动排到队列中，等程序执行完后， 再去执行event loop中的事务
    const myPromise = () => Promise.resolve('I have resolved')
    function FirstFun (){
        myPromise().then(res=>console.log(res))
        console.log('first')
    }
    async function SecoundFun () {
        console.log('second 1')
        console.log('second', await myPromise())
        console.log('second 2')
    }
    FirstFun()
    SecoundFun()
  </script>
</head>
<body>
  
</body>
</html>